﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace PedesTrainProject.Grid
{
    [Serializable()]
    public class InFlowFlag : Element, ISerializable
    {
        private List<KeyValuePair<DateTime, int>> intervals;

        public List<KeyValuePair<DateTime, int>> Intervals
        {
            get { return intervals; }
            set { intervals = value; }
        }
        public InFlowFlag()
        {
        }
        public InFlowFlag(List<KeyValuePair<DateTime, int>> _intervals)
        {
            intervals = _intervals;
        }

        #region Serialize
        public InFlowFlag(SerializationInfo info, StreamingContext ctxt)
        {
            this.name = (string)info.GetValue("Name", typeof(string));
            this.skin = (string)info.GetValue("Skin", typeof(string));
            this.intervals = (List<KeyValuePair<DateTime, int>>)info.GetValue("Intervals", typeof(List<KeyValuePair<DateTime, int>>));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("Name", this.name);
            info.AddValue("Skin", this.skin);
            info.AddValue("Intervals", this.intervals);
        }
        #endregion
    }
}
